home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Controls.h < prev    next >
Text File  |  1991-04-17  |  6KB  |  211 lines

  1. /************************************************************
  2.  
  3. Created: Sunday, January 6, 1991 at 9:03 PM
  4.     Controls.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc. 1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __CONTROLS__
  15. #define __CONTROLS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21.  
  22. enum {
  23.  
  24.     pushButProc = 0,
  25.     checkBoxProc = 1,
  26.     radioButProc = 2,
  27.     useWFont = 8,
  28.     scrollBarProc = 16,
  29.     inButton = 10,
  30.     inCheckBox = 11,
  31.     inUpButton = 20,
  32.     inDownButton = 21,
  33.     inPageUp = 22,
  34.     inPageDown = 23,
  35.     inThumb = 129,
  36.  
  37.     popupMenuProc = 1008,   /* 63 * 16 */
  38.     inLabel = 1,
  39.     inMenu = 2,
  40.     inTriangle = 4
  41. };
  42.  
  43. enum {    popupFixedWidth        = 1 << 0,    popupReserved            = 1 << 1,    popupUseAddResMenu    = 1 << 2,
  44.         popupUseWFont        = 1 << 3};
  45.  
  46. enum {    popupTitleBold        = 1 << 8,    popupTitleItalic    = 1 << 9,    popupTitleUnderline    = 1 << 10,
  47.         popupTitleOutline    = 1 << 11,    popupTitleShadow    = 1 << 12,    popupTitleCondense    = 1 << 13,
  48.         popupTitleExtend    = 1 << 14,    popupTitleNoStyle    = 1 << 15};
  49.  
  50.  
  51. enum {
  52.  
  53.     popupTitleLeftJust = 0x00000000,
  54.     popupTitleCenterJust = 0x00000001,
  55.     popupTitleRightJust = 0x000000FF,
  56.  
  57. /*
  58. axis constraints for DragGrayRgn call*/
  59.     noConstraint = 0,
  60.     hAxisOnly = 1,
  61.     vAxisOnly = 2,
  62.  
  63. /*
  64. control messages*/
  65.     drawCntl = 0,
  66.     testCntl = 1,
  67.     calcCRgns = 2,
  68.     initCntl = 3,
  69.     dispCntl = 4,
  70.     posCntl = 5,
  71.     thumbCntl = 6,
  72.     dragCntl = 7,
  73.     autoTrack = 8,
  74.     calcCntlRgn = 10,
  75.     calcThumbRgn = 11,
  76.  
  77.     cFrameColor = 0,
  78.     cBodyColor = 1,
  79.     cTextColor = 2
  80. };
  81. enum {
  82.     cThumbColor = 3
  83. };
  84.  
  85. struct ControlRecord {
  86.     struct ControlRecord **nextControl;
  87.     WindowPtr contrlOwner;
  88.     Rect contrlRect;
  89.     unsigned char contrlVis;
  90.     unsigned char contrlHilite;
  91.     short contrlValue;
  92.     short contrlMin;
  93.     short contrlMax;
  94.     Handle contrlDefProc;
  95.     Handle contrlData;
  96.     ProcPtr contrlAction;
  97.     long contrlRfCon;
  98.     Str255 contrlTitle;
  99. };
  100.  
  101. typedef struct ControlRecord ControlRecord;
  102. typedef ControlRecord *ControlPtr, **ControlHandle;
  103.  
  104. struct CtlCTab {
  105.     long ccSeed;            /*reserved*/
  106.     short ccRider;          /*see what you have done - reserved*/
  107.     short ctSize;           /*usually 3 for controls*/
  108.     ColorSpec ctTable[4];
  109. };
  110.  
  111. typedef struct CtlCTab CtlCTab;
  112. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  113.  
  114. struct AuxCtlRec {
  115.     Handle acNext;          /*handle to next AuxCtlRec*/
  116.     ControlHandle acOwner;  /*handle for aux record's control*/
  117.     CCTabHandle acCTable;   /*color table for this control*/
  118.     short acFlags;          /*misc flag byte*/
  119.     long acReserved;        /*reserved for use by Apple*/
  120.     long acRefCon;          /*for use by application*/
  121. };
  122.  
  123. typedef struct AuxCtlRec AuxCtlRec;
  124. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  125.  
  126.  
  127. #ifdef __cplusplus
  128. extern "C" {
  129. #endif
  130. pascal ControlHandle NewControl(WindowPtr theWindow,const Rect *boundsRect,
  131.     ConstStr255Param title,Boolean visible,short value,short min,short max,
  132.     short procID,long refCon)
  133.     = 0xA954; 
  134. pascal void SetCTitle(ControlHandle theControl,ConstStr255Param title)
  135.     = 0xA95F; 
  136. pascal void GetCTitle(ControlHandle theControl,Str255 title)
  137.     = 0xA95E; 
  138. pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  139.     = 0xA9BE; 
  140. pascal void DisposeControl(ControlHandle theControl)
  141.     = 0xA955; 
  142. pascal void KillControls(WindowPtr theWindow)
  143.     = 0xA956; 
  144. pascal void HideControl(ControlHandle theControl)
  145.     = 0xA958; 
  146. pascal void ShowControl(ControlHandle theControl)
  147.     = 0xA957; 
  148. pascal void DrawControls(WindowPtr theWindow)
  149.     = 0xA969; 
  150. pascal void Draw1Control(ControlHandle theControl)
  151.     = 0xA96D; 
  152. pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  153.     = 0xA95D; 
  154. pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  155.     = 0xA953; 
  156. pascal void UpdateControls(WindowPtr theWindow,RgnHandle updateRgn)
  157.     = 0xA953; 
  158. pascal void MoveControl(ControlHandle theControl,short h,short v)
  159.     = 0xA959; 
  160. pascal void SizeControl(ControlHandle theControl,short w,short h)
  161.     = 0xA95C; 
  162. pascal void SetCtlValue(ControlHandle theControl,short theValue)
  163.     = 0xA963; 
  164. pascal short GetCtlValue(ControlHandle theControl)
  165.     = 0xA960; 
  166. pascal void SetCtlMin(ControlHandle theControl,short minValue)
  167.     = 0xA964; 
  168. pascal short GetCtlMin(ControlHandle theControl)
  169.     = 0xA961; 
  170. pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  171.     = 0xA965; 
  172. pascal short GetCtlMax(ControlHandle theControl)
  173.     = 0xA962; 
  174. pascal void SetCRefCon(ControlHandle theControl,long data)
  175.     = 0xA95B; 
  176. pascal long GetCRefCon(ControlHandle theControl)
  177.     = 0xA95A; 
  178. pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  179.     = 0xA96B; 
  180. pascal ProcPtr GetCtlAction(ControlHandle theControl)
  181.     = 0xA96A; 
  182. pascal void DragControl(ControlHandle theControl,Point startPt,const Rect *limitRect,
  183.     const Rect *slopRect,short axis)
  184.     = 0xA967; 
  185. pascal short TestControl(ControlHandle theControl,Point thePt)
  186.     = 0xA966; 
  187. pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  188.     = 0xA968; 
  189. pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle *theControl)
  190.     = 0xA96C; 
  191. pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  192.     = 0xAA43; 
  193. pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHandle *acHndl)
  194.     = 0xAA44; 
  195. pascal short GetCVariant(ControlHandle theControl)
  196.     = 0xA809; 
  197. void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  198.     const Rect *slopRect,short axis); 
  199. ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  200.     Boolean visible,short value,short min,short max,short procID,long refCon); 
  201. short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl); 
  202. void getctitle(ControlHandle theControl,char *title); 
  203. void setctitle(ControlHandle theControl,char *title); 
  204. short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc); 
  205. short testcontrol(ControlHandle theControl,Point *thePt); 
  206. #ifdef __cplusplus
  207. }
  208. #endif
  209.  
  210. #endif
  211.